package com.io.model;

import com.io.protocol.CommandConstants;
import io.netty.buffer.ByteBuf;

//Server => Terminal
//协议
//------------------------
//Result   byte         1 = 1
//------------------------
public class RegisterResp extends BaseModel {

    static public final byte RegisterRespRes_IncorrectPassword = 1;
    static public final byte RegisterRespRes_TerminalNotExist = 2;

    static private final int TotalLength = 1;

    public RegisterResp(){
        command = CommandConstants.RegisterResp;
    }
    private byte result; //登录结果

    public byte getResult() {
        return result;
    }
    public void setResult(byte result) {
        this.result = result;
    }

    @Override
    protected int calculateMainBodyLength(){
        return TotalLength;
    }

    @Override
    protected void writeMainBodyToByteBuff(ByteBuf buff){
        buff.writeByte(result);
    }
}
